﻿@using Fly.Domain.Models
@model User
@{
    ViewBag.Title = "用户中心";
    Layout = "~/Views/Shared/_LayoutPage.cshtml";
    var myVisitors = ViewBag.MyVisitors as Fly.Domain.Infrastructure.GetListsResponse<Visitor>;
}


<div class="main layui-clear">
    <h2 class="page-title">用心中心</h2>
    <div class="wrap">
        <div class="content">
            @if (!Model.EmailConfirmed)
            {
                <div class="fly-msg">您的邮箱尚未验证，这比较影响您的帐号安全，<a href="@Url.Action("Activate","Account")">立即去激活？</a></div>
            }
            <div class="fly-tab user-tab">
                <span id="LAY-mine">
                    <a href="javascript:;" class="tab-this" type="mine-post">我的求解（<cite>@Model.PostCount</cite>）</a>
                    <a href="@Url.Action("Message","Account")">我的消息</a>
                    <a href="@Url.Action("Home", "Account", new { userId = Model.Id })">我的主页</a>
                </span>
            </div>
            <div class="user-mine">
                <ul class="mine-view jie-row" style="display:block;">
                    <li class="fly-none">@*<a>此处消息由Ajax读取，见mods/user.js</a>*@</li>
                </ul>
            </div>
            <div id="LAY-page"></div>
        </div>
    </div>

    <div class="edge">
        <div class="user-about">
            <a href="/user/set#avatar" title="修改头像">
                <img class="user-avatar" src="@Model.HeadPortrait">
            </a>
            <p>
                <span style="color:#333">@Model.Nickname</span>
                <span style="color:#c00;">@Model.Title</span>
                <!-- <span style="color:#5FB878;">管理员</span> -->
            </p>
            <p>
                <span>加入时间：@Model.CreateTime.ToString("yyyy-MM-dd")</span>
                <span>
                    飞吻：<em style="color:#FF7200">@Model.Integral</em>
                </span>
            </p>
            <p>
                <span>城市：@Model.City</span>
                <span>性别：@Fly.Domain.Helper.EnumHelper.GetEnumDescription(Model.Gender)</span>
            </p>

            <div class="user-looklog" style="padding-bottom:200px;">
                <h3>最近访客</h3>
                <span>
                    @if (myVisitors.IsSuccess)
                    {
                        foreach (var item in myVisitors.Items)
                        {
                            <a href="@Url.Action("Home", "Account", new { userId = item.VisitorUserId })">
                                <img src="@item.VisitorUser.HeadPortrait">
                                <cite>@item.VisitorUser.Nickname</cite>
                                <i>@item.TimeAgo</i>
                            </a>
                        }
                    }
                    else
                    {
                        <a href="javascript:;" style="text-align: center; width: 100%;padding: 15px; background-color: #F8F8F8; height: 30px;line-height: 30px; cursor:default;">@myVisitors.Message</a>
                    }
                </span>
            </div>
        </div>
    </div>
</div>
